//
//  STCollectionLayout.m
//  STNewTools
//
//  Created by stoneobs on 2017/7/31.
//  Copyright © 2017年 stoneobs. All rights reserved.
//

#import "STCollectionLayout.h"
#import "STCalendarKitItemCollectionViewCell.h"
@implementation STCollectionLayout

- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect{


    NSArray * array = [super layoutAttributesForElementsInRect:rect];
    
    for (UICollectionViewLayoutAttributes * att in array) {
        NSInteger section = att.indexPath.section;
        NSInteger item = att.indexPath.item;
        
        CGFloat screenWith = [UIScreen mainScreen].bounds.size.width;
        att.frame = CGRectMake(screenWith * section + item % 7  * itemWith,itemWith* (NSInteger)(item/7) , itemWith, itemWith);
    }

    return array;
}
@end
